//
//  LoginView.swift
//  hunan_ios_ldnsm
//
//  Created by I-Q-I on 2019/4/28.
//  Copyright © 2019 I-Q-I. All rights reserved.
//

import UIKit

class LoginView: UIView {
    
     lazy var phoneInput: UITextField = {
        let el = UITextField()
        el.borderStyle = UITextField.BorderStyle.none
        el.tintColor = UIColor.colHui
        el.keyboardType = UIKeyboardType.phonePad
        el.font = UIFont.middle
        el.placeholder = "请输入手机号"
        return el
    }()
     lazy var phoneInputBottom: UIView = {
        let el = UIView()
        el.backgroundColor = UIColor.colHuiwhite
        return el
    }()
     lazy var pwdInput: UITextField = {
        let el = UITextField()
        el.isSecureTextEntry = true
        el.borderStyle = UITextField.BorderStyle.none
        el.tintColor = UIColor.colHui
        el.font = UIFont.middle
        el.placeholder = "请输入密码"
        el.rightViewMode = .always
        return el
    }()
     lazy var pwdInputBottom: UIView = {
        let el = UIView()
        el.backgroundColor = UIColor.colHuiwhite
        return el
    }()
     lazy var registerBtn: UIButton = {
        let el = UIButton(type: .system)
        el.titleLabel?.font = UIFont.middle
        
        el.setTitle("立即注册", for: .normal)
        el.setTitleColor(UIColor.colBlack, for: .normal)
        el.titleLabel?.textAlignment = NSTextAlignment.left
        return el
    }()

    
     lazy var loginBtn: UIButton = {
        let el = UIButton(type: .system)
        el.titleLabel?.font = UIFont.middle
      
        el.setTitle("登录", for: .normal)
        el.backgroundColor = UIColor.colOrange
        el.setTitleColor(UIColor.white, for: .normal)
        return el
    }()
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        
        self.backgroundColor = UIColor.white
        
        self.addSubview(phoneInput)
        phoneInput.snp.makeConstraints{
            $0.height.equalTo(size40)
            $0.right.equalTo(-size20)
            $0.left.equalTo(size20)
            $0.top.equalTo(size25)
        }
        
        self.addSubview(phoneInputBottom)
        phoneInputBottom.snp.makeConstraints{
            $0.height.equalTo(0.5)
            $0.right.left.equalTo(phoneInput)
            $0.top.equalTo(phoneInput.snp.bottom).offset(0)
        }
        
        self.addSubview(pwdInput)
        pwdInput.snp.makeConstraints{
            $0.height.equalTo(size40)
            $0.right.equalTo(-size20)
            $0.left.equalTo(size20)
            $0.top.equalTo(phoneInput.snp.bottom).offset(size15)
        }
        
        self.addSubview(pwdInputBottom)
        pwdInputBottom.snp.makeConstraints{
            $0.height.equalTo(0.5)
            $0.right.left.equalTo(phoneInput)
            $0.top.equalTo(pwdInput.snp.bottom).offset(0)
        }
        self.addSubview(registerBtn)
        registerBtn.snp.makeConstraints{
            $0.left.equalTo(phoneInput.snp.left)
            $0.top.equalTo(pwdInput.snp.bottom).offset(size15)
        }
        self.addSubview(loginBtn)
        loginBtn.snp.makeConstraints{
            $0.right.equalTo(-size20)
            $0.left.equalTo(size20)
            $0.height.equalTo(size40)
            $0.top.equalTo(registerBtn.snp.bottom).offset(size40)
        }
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }


    
}
